package com.jian.sys.mapper;

import com.jian.sys.pojo.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 剑
 * @since 2020-01-13
 */
public interface RoleMapper extends BaseMapper<Role> {
    //根据角色id删除对应sys_role_permission
    public void deletePermissionByRid(@Param("id") Serializable id);
    //根据角色id删除对应sys_role_user
    public void deleteUserByRid(@Param("id") Serializable id);
    //根据角色的rid查询角色拥有的权限和菜单的pid
    List<Integer> queryRolePermissionByRid(@Param("id") Integer roleId);
    //保存分配的权限
    void saveSelectPermissionRole(@Param("rid") Integer rid,@Param("pid") Integer pid);

    void deleteRolePermissionById(Integer rid);
}
